<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title></title>
</head>
<link rel="stylesheet" type="text/css" href="/admin/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="/admin/css/bootstrap-table.min.css"/>
<link rel="stylesheet" type="text/css" href="/admin/css/style.min.css"/>
<link rel="stylesheet" type="text/css" href="/admin/css/font-awesome.css"/>
<link rel="stylesheet" href="/admin/layui/css/layui.css">

<script src="/admin/js/jquery-3.3.1.min.js"></script>
<script src="/admin/js/bootstrap.js"></script>
<script src="/admin/js/bootstrap-table.js" type="text/javascript" charset="utf-8"></script>
<script src="/admin/js/bootstrap-table-zh-CN.js"></script>
<script src="/admin/layui/layui.js" charset="utf-8"></script>
<script src="/admin/js/base.js" charset="utf-8"></script>
<script src="/admin/js/api.js" charset="utf-8"></script>
<script src="/admin/js/common.js" charset="utf-8"></script>

<body>
	<div class="rigthContent">
		<div class="col-sm-12">
			<div class="ibox float-e-margins">
				<div class="search-top" >
					<div class="layui-form-item">
						<div class="layui-inline tool_bar " style="float: right;">
							<a href="javascript:void(0);" class="btn btn-default btn-sm" onclick="windowloadList()">
								<span class="icon icon-refresh handle_ioc"></span>刷新
							</a>
							<a href="javascript:void(0);" class="btn btn-default btn-sm common-add" onclick="commonAdd(Api.admin.base.role.addHtml)">
								<span class="icon  icon-plus-sign handle_ioc "></span>新增
							</a>
							<a href="javascript:void(0);" class="btn btn-default btn-sm common-update" onclick="commonUpdate(Api.admin.base.role.addHtml, 'roleId')">
								<span class="icon icon-edit handle_ioc  "></span>编辑
							</a>
							<a href="javascript:void(0);" class="btn btn-default btn-sm common-delete" onclick="commonDelete(Api.admin.base.role.deleteBaseRole, 'roleId')">
								<span class="icon icon-remove-sign handle_ioc  "></span>删除
							</a>
							<a href="javascript:void(0);" class="btn btn-default btn-sm common-add" onclick="addAudit()">
								<span class="icon  icon-plus-sign handle_ioc "></span>授权
							</a>
						</div>
					</div>
				</div>
				<div class="content">
					<div>
						<table class="table" id="table_list" aria-describedby="editable_info" style="table-layout:fixed"></table>
					</div>
				</div>
			</div>
		</div>
	</div>

<script>
    // 双击效果
    dblclickListApi = {
        URL: Api.admin.base.user.viewHtml,
        ID: 'id',
        TITLE: 'Banner图详情',
        WIDTH: '800px',
        HEIGHT: '600px'
    };

	conlums = [{
		field: 'check',
		checkbox: true,
		width: '0',
		class: 'tableCheckStatus',
	},{
		field: 'Number',class: 'tableNumber',//可不加
		title: '序号',
		align: 'center',
		valign: 'top',
		width: '30px',
		formatter: function (value, row, index) {
			return tableNumber(index);
		}
	}, {
		field: 'name',
		title: '角色名称',
		align: 'center',
		width: '200'
	},{
		field: 'remark',
		title: '描述',
		width: '200',
		align: 'center'
	},{
		field: 'createDate',
		title: '创建时间',
		width: '120',
		align: 'center',
		formatter: function (value, row, index) {
			return dateFormat(value, "yyyy-MM-dd HH:mm:ss");
		}
	}];

	layuiReady(function () {
		// 初始化数据
		init_table(Url.creatUrl(Api.admin.base.role.getBaseRoleList, {}), conlums);
	});

	//授权
	function addAudit(){
		var row = select_one_row();
		if(row){
			var id = row["roleId"];
			var name = row["name"];
			var updateUrl = Url.creatUrl(Api.admin.base.role.authorListHtml, {id: id, name: encodeURI(encodeURI(name))});
			locationUrl(updateUrl, '授权用户');
		} else {
			return;
		}
	}

</script>
</body>

</html>